﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EuroManager.Domain.Simulator.World;
using NUnit.Framework;

namespace EuroManager.Domain.Simulator.Tests.World
{
    [TestFixture]
    public class ClockTests
    {
        [Test]
        public void ShouldStartWithZeroTime()
        {
            Clock clock = new Clock(TimeSpan.FromMinutes(1));

            Assert.AreEqual(TimeSpan.Zero, clock.CurrentTime);
        }

        [Test]
        public void ShouldAdvanceCurrentTime()
        {
            float elapsedTime = (float)TimeSpan.FromMinutes(1).TotalSeconds;
            
            Clock clock = new Clock(TimeSpan.FromMinutes(9));
            clock.Update(elapsedTime);

            Assert.AreEqual(TimeSpan.FromMinutes(10), clock.CurrentTime);
        }
    }
}
